<?php
// $session_data = 'd48b6a940654ff2c900ca50758a30075|lang=s:3:"eng";|last_page=s:16:"teetime/calendar";|cart=a:1:{s:3:"idx";i:0;}|auth=a:6:{s:7:"user_id";s:32:"7322f75cc7ba16db1799fd8d25dbcde4";s:8:"username";s:5:"admin";s:5:"perms";s:5:"admin";s:10:"first_name";s:4:"Site";s:9:"last_name";s:13:"Administrator";s:9:"vendor_id";s:1:"1";}|cld=a:0:{}|player=a:0:{}|player_guest=N;|ps_vendor_id=s:1:"1";|';
// $session_data = 'a:10:{s:12:"gulf-s-files";s:32:"21ca1ba5bcdd1b294f4c71a532986590";s:10:"accounting";s:32:"86e1e1bc8c1b5840a4ca43c482e05ec6";s:19:"sales-and-marketing";s:32:"3de79e9d8982392a65d7051145054bb2";s:6:"orders";s:32:"a7076affa76ea2bf0c341bdea9e352a5";s:20:"userfiles-compliance";s:32:"cea0e3664731d92c7a7eb2ec96a26653";s:10:"compliance";s:32:"22e42ef0dd50ef179e815c9d4ec671b8";s:12:"fee-schedule";s:32:"18f73eaf5eb57c0ab6e9299cf3e3644f";s:14:"human-resource";s:32:"8e67ca8fd534ddafdc7fcf5bf6935ecc";s:16:"policy-rocedures";s:32:"1f8ea945dd699849c9b87eb757a23ee3";s:7:"funding";s:32:"827a39b10276efb86bf0e454a64afb50";}';
$filename = $_Q_module_path."repo.ser";
$handle = fopen($filename, "r");
$session_data = fread($handle, filesize($filename));
// $serial_spacer = "|";
$serial_spacer = ";";
$categories = array();
$category = strtok($session_data, $serial_spacer);
//var_dump($category);
//{*}*[a-z]+:[0-9]+:*"display"
$array = array();
$status = "";
$array[] = "display";
$array[] = "PATH";
$array[] = "slug";
$i = 0;
$count = 0;
while ($category = strtok($serial_spacer)) {
	$a = preg_replace('/{*}*[a-zA-Z]+:[0-9]+:*\"*/',"",$category);
	$a = preg_replace('/\"*/',"",$a);
	// var_dump($a);
	if(in_array($a, $array)){
		$status = $a;
		$i++;
		continue;
	}
	if($status){		
		$status = strtolower($status);
		$categories[$count]->$status = $a;
		$count = $status == end($array) ? $count + 1 : $count;
		$status = "";
	}
}

// Obtain a list of columns
foreach ($categories as $key => $row) {
    $display[$key]  = $row->display;
}
$a =array_multisort($display, SORT_ASC, $categories);
var_dump($display);
?>
